trigger: none

schedules:
- cron: "0 11 * * *" # 11 AM UTC => 3 AM PST
  displayName: Outerloop scheduled build
  branches:
    include:
    - main
    - release/*.*

variables:
  - template: variables.yml

extends:
  template:  /eng/pipelines/common/templates/pipeline-with-resources.yml
  parameters:
    stages:
    - stage: Build
      jobs:

        - template: /eng/pipelines/common/platform-matrix.yml
          parameters:
            jobTemplate: /eng/pipelines/common/global-build-job.yml
            helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
            buildConfig: Release
            platforms:
            - ${{ if eq(variables['includeWindowsOuterloop'], true) }}:
              - windows_x86
              - ${{ if eq(variables['isRollingBuild'], true) }}:
                - windows_x64
            - ${{ if eq(variables['includeLinuxOuterloop'], true) }}:
              - ${{ if eq(variables['isRollingBuild'], true) }}:
                - linux_x64
                - linux_arm
                - linux_arm64
                - linux_musl_x64
                - linux_musl_arm64
            - ${{ if and(eq(variables['includeOsxOuterloop'], true), eq(variables['isRollingBuild'], true)) }}:
              - osx_arm64
              - osx_x64
            jobParameters:
              testScope: outerloop
              nameSuffix: CoreCLR_Release
              buildArgs: -s clr+host.native+libs+libs.tests -lc $(_BuildConfig) -hc $(_BuildConfig) -rc Release -testscope outerloop /p:ArchiveTests=true
              timeoutInMinutes: 180
              includeAllPlatforms: ${{ variables['isRollingBuild'] }}
              # extra steps, run tests
              postBuildSteps:
                - template: /eng/pipelines/libraries/helix.yml
                  parameters:
                    testScope: outerloop
                    creator: dotnet-bot
                    testRunNamePrefixSuffix: CoreCLR_$(_BuildConfig)

        - ${{ if eq(variables['isRollingBuild'], false) }}:
          - template: /eng/pipelines/common/platform-matrix.yml
            parameters:
              jobTemplate: /eng/pipelines/common/global-build-job.yml
              helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
              buildConfig: Debug
              platforms:
              - ${{ if eq(variables['includeWindowsOuterloop'], true) }}:
                - windows_x64
              - ${{ if eq(variables['includeLinuxOuterloop'], true) }}:
                - linux_x64
                - linux_musl_x64
              - ${{ if eq(variables['includeOsxOuterloop'], true) }}:
                - osx_arm64
                - osx_x64
              jobParameters:
                testScope: outerloop
                nameSuffix: CoreCLR_Debug
                buildArgs: -s clr+host.native+libs+libs.tests -lc $(_BuildConfig) -hc $(_BuildConfig) -rc Release -testscope outerloop /p:ArchiveTests=true
                timeoutInMinutes: 180
                includeAllPlatforms: ${{ variables['isRollingBuild'] }}
                # extra steps, run tests
                postBuildSteps:
                  - template: /eng/pipelines/libraries/helix.yml
                    parameters:
                      testScope: outerloop
                      creator: dotnet-bot
                      testRunNamePrefixSuffix: CoreCLR_$(_BuildConfig)

        - ${{ if eq(variables['includeWindowsOuterloop'], true) }}:
          - template: /eng/pipelines/common/platform-matrix.yml
            parameters:
              jobTemplate: /eng/pipelines/common/global-build-job.yml
              helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
              buildConfig: Release
              platforms:
              - windows_x86
              - ${{ if eq(variables['isRollingBuild'], true) }}:
                - windows_x64
              jobParameters:
                framework: net48
                testScope: outerloop
                nameSuffix: NET48
                buildArgs: -s libs+libs.tests -c $(_BuildConfig) -testscope outerloop /p:ArchiveTests=true -f net48
                timeoutInMinutes: 180
                includeAllPlatforms: ${{ variables['isRollingBuild'] }}
                # extra steps, run tests
                postBuildSteps:
                  - template: /eng/pipelines/libraries/helix.yml
                    parameters:
                      testScope: outerloop
                      creator: dotnet-bot
                      extraHelixArguments: /p:BuildTargetFramework=net48
